/**
 * 飞机基类
 */
var BaseBody = require('./../BaseBody');
var EnemyBody = require('./../Enum/EnumBody');
module.exports = cc.Class(
{
    extends: BaseBody,

    properties:
    {
        audioClip:
        {
            type: cc.AudioClip,
            default: null,
            displayName: '爆炸声'
        }
    },
    onLoad()
    {
        this._super();
        this.setEnumBody(EnemyBody.BOMB);
        this.playBomb();
    },

    onCollisionEnter: function(other)
    {
        var body = this._super(other);
        if (null == body)
        {
            cc.error('发现不明物品请处理');
            return null;
        }
        return body;
    },

    /**
     * 播放爆炸特效 
     */
    playBomb: function()
    {
        this.playBombAudio();
    },

    /**
     * 播放挂载音效
     */
    playBombAudio()
    {
        if (!!this.audioClip)
        {
            cc.audioEngine.play(this.audioClip, false, 1);
        }
    }
});